package com.ys.erp.entity.data.bean;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import lombok.Data;

/**
 * @author lwj
 * @date 2025/5/26
 */
    
@Data
@TableName(value = "t_user_cat_money_record")
public class UserCatMoneyRecord {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 关联猫钱包id
     */
    @TableField(value = "user_cat_id")
    private Long userCatId;

    /**
     * 猫咪编码
     */
    @TableField(value = "cat_code")
    private String catCode;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 记录金额，单位分
     */
    @TableField(value = "record_num")
    private Long recordNum;

    /**
     * 记录类型，0：收入，1：支出
     */
    @TableField(value = "record_type")
    private Integer recordType;

    /**
     * 收入类型，0，后台增加1：商品退款,2自动充值
     */
    @TableField(value = "income_type")
    private Integer incomeType;

    /**
     * 支出类型，0：购买商品消费，1：后台扣除
     */
    @TableField(value = "expend_type")
    private Integer expendType;

    /**
     * 如果是购买商品支出，记录订单id
     */
    @TableField(value = "order_id")
    private Long orderId;

    /**
     * 操作后剩余余额备份
     */
    @TableField(value = "cat_money_bak")
    private Long catMoneyBak;

    /**
     * 记录描述
     */
    @TableField(value = "record_describe")
    private String recordDescribe;

    /**
     * 备注
     */
    @TableField(value = "record_remark")
    private String recordRemark;

    /**
     * 操作人
     */
    @TableField(value = "emp_id")
    private Long empId;

    /**
     * 操作人姓名
     */
    @TableField(value = "emp_name")
    private String empName;

    @TableField(value = "version")
    @Version
    private Integer version;

    @TableField(value = "create_time")
    private LocalDateTime createTime;

    @TableField(value = "update_time",  update = "now()")
    private LocalDateTime updateTime;
}